package designMode;

/**
 * Created by rzd on 2017/5/11.
 */
public class SingletonPattern {
    private volatile static SingletonPattern instance;
    public static SingletonPattern getInstance()
    {
        if(instance==null)
        {
            synchronized (SingletonPattern.class)
            {
                if(instance==null)instance=new SingletonPattern();
            }
        }
        return instance;
    }
}
